package com.uuticketweb.ticket.flight.service.factory;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.uuticketweb.ticket.flight.service.FlightService;

public class FlightServiceFactory {

	private static FlightService flightservice = null;
	public static synchronized FlightService getFlightService(){
		if(flightservice == null){
			ApplicationContext ct = WebApplicationContextUtils.getWebApplicationContext(
					ServletActionContext.getServletContext());
			flightservice = (FlightService)ct.getBean("flightService");
		}
		return flightservice;
	}
}
